
if exists(select name from sysobjects where name = 'sp_DiemGetByHocKy')
	drop proc sp_DiemGetByHocKy
go
/*
	Created by: Phuoc NH
	Created on: 04/012/2013 (dd/mm/yyyy)
	Description: 
	--

	File:$sql-scripts/Proc.sp_DiemGetByHocKy.sql
*/

create proc sp_DiemGetByHocKy
@MaSinhVien varchar(50),
@NamHoc varchar(50),
@HocKy varchar(50)
as
begin
	select * from SinhVien a inner join BangDiem b on a.MaSinhVien=b.MaSinhVien and a.MaSinhVien=@MaSinhVien inner join Mon c on c.MaMon=b.MaMon inner join lop d on a.MaLop =d.MaLop inner join ChuongTrinhDT e on d.MaCT=e.MaCT inner join ChuongTrinhCT f on f.MaCT=e.MaCT  where b.HocKy=@HocKy and SUBSTRING(b.NamHoc,1,4)=@NamHoc
end

